<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <style>
    </style>
</block>
<block name="content" > 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get">
                        <div class="layui-input-inline">
                            <input type="text" name="form_name" placeholder="表单名" value="{$_GET['form_name']}" class="layui-input search_input">
                        </div>
                        <div class="layui-inline">
                            <span class="btn-upload form-group">
                                <select name="flow_sort" class="layui-input search_input" style="width:150px">
                                    <option value=''>流程分类</option>
                                    <foreach name="flowSorts" item="sort">
                                        <option value="{$sort.sort_id}" {$_GET['flow_sort'] == $sort['sort_id'] ? 'selected' : ''}>{$sort.sort_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <div class="layui-input-inline" style="width:45%">
                            <a class="layui-btn search_btn search" data-url="{:U('formDesign')}"> 查询</a>
                            <a class="layui-btn search_btn" href="{:U('saveFormDesign')}" > 新建表单</a>
                        </div>
                    </form>

                </blockquote>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box">
                    <!-- 表单列表 -->
                    <div class="layui-tab-item layui-field-box layui-show">
                        <table class="layui-table table-hover" lay-even="" lay-skin="nob">
                            <thead>
                                <tr>
                                    <th style="width:7%">表单ID</th>
                                    <th>表单名称</th>
                                    <th>表单描述</th>
                                    <th>字段数</th>
                                    <th>修改时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            <notempty name="forms">
                                <foreach name="forms" item="row" key="key">
                                    <tr>
                                        <td>{$row.form_id}</td>
                                        <td>{$row.form_name}</td>
                                        <td>{$row.form_desc}</td>
                                        <td>{$row.fields}</td>
                                        <td><if condition="$row['edit_time'] neq 0">{$row.edit_time|date="Y-m-d H:i:s",###}<else/>无</if></td>
                                        <td>
                                            <a href="{:U('saveFormDesign',array('form_id'=>$row['form_id']))}">编辑</a>
                                            <a href="{:U('formView',array('form_id'=>$row['form_id']))}">预览</a>
                                            <a class="delForm pointer" data-url="{:U('delForm',array('form_id'=>$row['form_id']))}">删除</a>
                                            <a class="export pointer" data-url="{:U('export',array('form_id'=>$row['form_id']))}">导出</a>
                                        </td>
                                    </tr>
                                </foreach>
                                <else/>
                                <tr><td colspan="2">暂无数据</td></tr>
                            </notempty>
                            </tbody>
                        </table>
                        <div class="larry-table-page clearfix">
                            <input type='hidden' id="followUrl" value="{:U('attentPlan')}">
                            <!--<a href="javascript:;" class="layui-btn layui-btn-small"><i class="iconfont icon-shanchu1"></i>删除</a>-->
                            <div id="page" class="page">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/flow.js"></script>
    <!--<script type="text/javascript" src="/Public/Admin/js/common.js" ></script>-->
    <script type="text/javascript">
        $(initFlowList());
        
        $('.export').on('click', function () {
            var url = $(this).attr('data-url');
            location.href=url;
        })

        $('.search').click(function () {
            $('form').submit();
        })

    </script>    
</block>

